//发布后测试接口（必须用域名及https）
// export const apiBaseUrl='https://cdjjyl.com.cn/LeZhiSmartServer/'
// 本地运行
export const apiBaseUrl='/api/'

//打包后本地微信开发工具调试本地接口
// export const apiBaseUrl = 'http://localhost:9099/'
// export const apiBaseUrl = 'http://192.168.1.13:9099/'
// export const apiBaseUrl = 'http://192.168.1.22:9099/'

// 项目版本  dev测试版   prob正式版
export const edition = "prob"

// 固定的乡村Code
export const communityCode = "2021030891230011";
//公众号appID
export const appId = 'wx58a3a3a0f777b527';


export const account = 'hyycadmin'
export const isPrintLog = true


//本地HbuilderX调试本地接口（反向代理）
// export const apiBaseUrl = '/api/'


const generateUuid = (randomFlag, min, max) => {
	var str = '',
		range = min,
		arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
	//随机产生
	if (randomFlag) {
		range = Math.round(Math.random() * (max - min)) + min;
	}
	for (var i = 0; i < range; i++) {
		var pos = Math.round(Math.random() * (arr.length - 1));
		str += arr[pos]
	}
	return str;
}
// 需要登陆的，都写到这里，否则就是不需要登陆的接口
const methodsToken = [
	'consumer/inquiryUser',
	'consumer/updateUserField',
	'changePassword',
	'consumer/enableNotification',
	'consumer/disableNotification',
	'consumer/isProductCollected',
	'consumer/collectProduct',
	'consumer/cancelCollectProduct',
	'consumer/inquiryProductCollect',
	'consumer/addProductToCart',
	'consumer/inquiryCartProductByIds',
	'consumer/changeOrder',
	'consumer/addSecKillOrder',
	'consumer/addGroupBuyOrder',
	'consumer/addPointOrder',
	'consumer/getCartProductNum',
	'consumer/inquiryCartProduct',
	'consumer/deleteProductFromShoppingCart',
	'consumer/updateShoppingCartProductNum',
	'consumer/clearShoppingCart',
	'consumer/inquiryOrder',
	'consumer/getCourierInfo',
	'consumer/inquiryPaymentAmount',
	'consumer/searchOrder',
	'consumer/searchOrderTotal',
	'consumer/searchGroupBuy',
	'consumer/searchGroupBuyTotal',
	'consumer/groupBuyDetail',
	'consumer/cancelOrder',
	'consumer/confirmOrder',
	'consumer/changeProductComment',
	'consumer/applyOrderAfterSale',
	'consumer/searchOrderAfterSale',
	'consumer/searchOrderAfterSaleTotal',
	'consumer/inquiryOrderAfterSaleDetail',
	'consumer/cancelOrderAfterSale',
	'consumer/updateOrderAfterSale',
	'consumer/courierOrderAfterSale',
	'inquiryNotes',
	'markNoteRead',
	'consumer/createPoster',
	'consumer/changeCoupon',
	'consumer/searchUserCoupon',
	'consumer/inquiryVoucher',
	'consumer/calculateCouponAmount',
	'consumer/calculateFreightAmount',
	'consumer/calculateDeliveryAmount',
	'consumer/calculateSecKillFreightAmount',
	'consumer/calculateSecKillDeliveryAmount',
	'consumer/calculateGroupBuyFreightAmount',
	'consumer/calculateGroupBuyDeliveryAmount',
	'consumer/calculatePointFreightAmount',
	'consumer/searchUserAward',
	'consumer/searchUserStatement',
	'consumer/searchUserPerformance',
	'consumer/searchUserWithdraw',
	'consumer/applyWithdraw',
	'consumer/inquiryUserWithdraw',
	'consumer/nextUserLevelData',
	'consumer/inquiryInvitedUsers',
	'consumer/changeUserDeliveryAddress',
	'consumer/inquiryUserDeliveryAddress',
	'consumer/initWechatPay',
	'consumer/initWechatPayH5',
	'consumer/initWechatPayApp',
	'consumer/initAlipay',
	'consumer/initAlipayApp',
	'consumer/balancePay',
	'consumer/seckillQuanId',
	'consumer/getSignDateNum',
	'consumer/isPointSigned',
	'consumer/signPoint',
	'consumer/searchUserPointStatement',
	'consumer/isMerchantFollowed',
	'consumer/followMerchant',
	'consumer/cancelFollowMerchant',
	'consumer/inquiryFollowedMerchant',
	'consumer/inquiryProfitWelfare',
	'consumer/receiveProfitWelfare',
	'consumer/updateUserImg',
	'consumer/getCommunityByUserInfo',
	'consumer/getCommunityInfosByCode',
	'consumer/getCommunityByAccount',
	'consumer/updateCurrCommunityUser',
	'consumer/addUserApplication',
	'consumer/verifyUserApplication',
	'consumer/userBindOwnerTest', //公众号登录绑定乡村
	'consumer/searchUserApplicationsByUserId',
	'proper/autoExamineApplication',
	'consumer/examineApplication',
	'consumer/getFloorsByCommunityId',
	'consumer/getUnitsByFloorId',
	'consumer/getRoomsByUnitId',
	'proper/getOwnerUserInfoByUserIdAndCommunityId',
	'consumer/getAccessToken',
	'consumer/memberPay/queryList',
	'consumer/memberPay/queryDetail',
	'consumer/activity/currency/manageArticle',
	'consumer/eventCurrency/manage',
	'consumer/eventCurrency/queryList',
	'consumer/eventCurrency/getById',
	'consumer/activity/currency/appletQueryArticle',
	'consumer/activity/currency/articelQueryDetail',
	'consumer/joinTheArmy/manage',
	'consumer/memberPay/initWeChatPay',
	'consumer/register/add',
	'consumer/register/queryList',
	'consumer/register/queryDetail',
	'consumer/getRoomsByUserId',
	'consumer/addRelationByUserId',
	'consumer/removeRelationByUserId',
	'consumer/proper/getOwnerRelationByUserId',
	'consumer/proper/addOrUpdateOwner',
	'consumer/proper/getOwnerByIdCard',
	'consumer/proper/setOwnerRelation',
	'consumer/proper/removeOwnerRelation',
	'consumer/proper/getOwners',
	'consumer/employment/insertOrUpdate',
	'consumer/employment/queryList',
	'consumer/employment/queryByUserId',
	'consumer/study/update',
	'consumer/enclosure/update',
	'consumer/work/update',
	'consumer/gridBasic/getAllParentGrids',
	'consumer/proper/getResidenceByAreaCode',
	'consumer/gridAdmin/queryAdminListByGridId',
	'consumer/userApplicationAddRoomInfo',
	'consumer/partyOrganization/getHeadquarters',
	'consumer/partyOrganizationOwnerRel/query',
	'consumer/hasApplication',
	'consumer/getOwnerRelationByFromId',
	'consumer/proper/updateOwnerRelation'
];

const post = (method, data, callback, hideLoading) => {
	//请求头header信息
	var postDataHeader = {
		requestId: generateUuid(false, 32),
		timeStamp: new Date().getTime(),
		applicationId: 'b2b2c-mobile',
		ip: '0.0.0.0'
	};
	//请求头body信息
	var postDataBody = data;
	// 判断token是否存在
	if (methodsToken.indexOf(method) >= 0) {
		// 获取用户token
		let userToken = uni.getStorageSync("userToken");
		if (!userToken) {
			uni.navigateTo({
				url: '/pages/public/login'
			})
			return false;
		} else {
			//将tokenId置于请求头信息
			postDataHeader.tokenId = userToken;
		}
	}
	var postData = {
		header: postDataHeader,
		body: postDataBody
	}
	//如果调用接口不明确指明不显示loading
	if (!hideLoading) {
		uni.showLoading({
			title: '加载中'
		});
	}
	console.log(apiBaseUrl + method)
	uni.request({
		url: apiBaseUrl + method,
		data: postData,
		method: 'POST',
		success: (response) => {
			if (!hideLoading) {
				uni.hideLoading();
			}
			const result = response.data
			// if (result.body && !result.body.status.statusCode === '0') {
			// 	// 登录信息过期或者未登录
			// 	if (result.body.status.errorCode === 'ErrorCode.common.0002' || result.body.status
			// 		.errorCode ===
			// 		'ErrorCode.common.0003' || result.body.status.errorCode === 'ErrorCode.common.0004'
			// 	) {
			// 		uni.removeStorageSync('userToken')
			// 		uni.showToast({
			// 			title: result.body.status.errorDesc,
			// 			icon: 'none',
			// 			duration: 1000,
			// 			complete: function() {
			// 				setTimeout(function() {
			// 					uni.hideToast();
			// 					uni.navigateTo({
			// 						url: '/pages/public/login'
			// 					})
			// 				}, 1000)
			// 			}
			// 		});
			// 	}
			// }
			callback(result);
		},
		complete: () => {
			if (!hideLoading) {
				uni.hideLoading();
			}
		},
		fail: (error) => {
			if (!hideLoading) {
				uni.hideLoading();
			}
			if (error && error.response) {
				showError(error.response);
			}
		},
	});

}


//插件post
const pluginsPost = (method, data, callback, hideLoading) => {
	uni.showLoading({
		title: '加载中'
	});

	// 判断token是否存在
	if (methodsToken.indexOf(method) >= 0) {
		// 获取用户token
		let userToken = db.get("userToken");
		if (!userToken) {
			// common.jumpToLogin();
			uni.navigateTo({
				url: '/pages/public/login'
			})
			return false;
		} else {
			data.token = userToken;
		}
	}
	uni.request({
		url: apiBaseUrl + 'plugins/' + method + '.html',
		data: data,
		header: {
			'Accept': 'application/json',
			'Content-Type': 'application/json',
			// 'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
		},
		method: 'POST',
		success: (response) => {
			uni.hideLoading();
			const result = response.data
			if (!result.status) {
				// 登录信息过期或者未登录
				if (result.data === 14007 || result.data === 14006) {
					db.del("userToken");
					uni.showToast({
						title: result.msg,
						icon: 'none',
						duration: 1000,
						complete: function() {
							setTimeout(function() {
								uni.hideToast();
								// #ifdef H5 || APP-PLUS
								uni.navigateTo({
									url: '/pages/login/login/index1'
								})
								// #endif
								// #ifdef MP-WEIXIN || MP-ALIPAY
								uni.navigateTo({
									url: '/pages/login/choose/index',
									animationType: 'pop-in',
									animationDuration: 200
								});
								// #endif
							}, 1000);
						}
					});
				}
			}
			callback(result);
		},
		fail: (error) => {
			uni.hideLoading();
			if (error && error.response) {
				showError(error.response);
			}
		},
		complete: () => {
			setTimeout(function() {
				uni.hideLoading();
			}, 250);
		}
	});

}

const showError = error => {
	let errorMsg = ''
	switch (error.status) {
		case 400:
			errorMsg = '请求参数错误'
			break
		case 401:
			errorMsg = '未授权，请登录'
			break
		case 403:
			errorMsg = '跨域拒绝访问'
			break
		case 404:
			errorMsg = `请求地址出错: ${error.config.url}`
			break
		case 408:
			errorMsg = '请求超时'
			break
		case 500:
			errorMsg = '服务器内部错误'
			break
		case 501:
			errorMsg = '服务未实现'
			break
		case 502:
			errorMsg = '网关错误'
			break
		case 503:
			errorMsg = '服务不可用'
			break
		case 504:
			errorMsg = '网关超时'
			break
		case 505:
			errorMsg = 'HTTP版本不受支持'
			break
		default:
			errorMsg = error.msg
			break
	}

	uni.showToast({
		title: errorMsg,
		icon: 'none',
		duration: 1000,
		complete: function() {
			setTimeout(function() {
				uni.hideToast();
			}, 1000);
		}
	});
}

// 文件上传
export const uploadFiles = (callback) => {
	uni.chooseImage({
		success: (chooseImageRes) => {
			uni.showLoading({
				title: '上传中...'
			});
			const tempFilePaths = chooseImageRes.tempFilePaths;
			const uploadTask = uni.uploadFile({
				url: apiBaseUrl + 'api.html', //仅为示例，非真实的接口地址
				filePath: tempFilePaths[0],
				fileType: 'image',
				name: 'file',
				headers: {
					'Accept': 'application/json',
					'Content-Type': 'multipart/form-data',
				},
				formData: {
					'method': 'images.upload',
					'upfile': tempFilePaths[0]
				},
				success: (uploadFileRes) => {
					callback(JSON.parse(uploadFileRes.data));
				},
				fail: (error) => {
					if (error && error.response) {
						showError(error.response);
					}
				},
				complete: () => {
					setTimeout(function() {
						uni.hideLoading();
					}, 250);
				}
			});
			// 					uploadTask.onProgressUpdate((res) => {
			//             console.log('上传进度' + res.progress);
			//             console.log('已经上传的数据长度' + res.totalBytesSent);
			//             console.log('预期需要上传的数据总长度' + res.totalBytesExpectedToSend);
			//
			//             // 测试条件，取消上传任务。
			//             if (res.progress > 50) {
			//                 uploadTask.abort();
			//             }
			// 					});
		}
	});
}



// 上传图片
export const uploadImage = (num, callback) => {
	uni.chooseImage({
		count: num,
		success: (res) => {
			uni.showLoading({
				title: '上传中...'
			});
			let tempFilePaths = res.tempFilePaths
			for (var i = 0; i < tempFilePaths.length; i++) {
				uni.uploadFile({
					url: apiBaseUrl + 'uploadMediaFile',
					filePath: tempFilePaths[i],
					fileType: 'image',
					name: 'files',
					headers: {
						'Accept': 'application/json',
						'Content-Type': 'multipart/form-data',
					},
					formData: {
						'method': 'images.upload',
						'upfile': tempFilePaths[i]
					},
					success: (uploadFileRes) => {
						callback(JSON.parse(uploadFileRes.data));
					},
					fail: (error) => {
						if (error && error.response) {
							showError(error.response);
						}
					},
					complete: () => {
						setTimeout(function() {
							uni.hideLoading();
						}, 250);
					},
				});
			}
		}
	});
}

// 获取人人video
export const getMusic = (data, callback, hideLoading) => post('consumer/getMusic', data, callback,
	hideLoading);
// 获取人人直播
export const getchannel = (data, callback, hideLoading) => post('consumer/getchannel', data, callback,
	hideLoading);
// 获取应用全局设置
export const applicationConfig = (data, callback, hideLoading) => post('getGlobalApplicationSetting', data, callback,
	hideLoading);

// 获取微信配置信息
export const getWeChatSettingInfo = (data, callback, hideLoading) => post('consumer/getWeChatSettingInfo', data,
	callback, hideLoading);

// 获取参数
export const getParameter = (data, callback, hideLoading) => post('inquiryParameter', data, callback, hideLoading);

// 微信公众号通过code换取open id
export const getOpenIdByCode4OfficialAccount = (data, callback, hideLoading) => post(
	'consumer/getOpenIdByCode4OfficialAccount', data, callback, hideLoading);

// 用户注册
export const reg = (data, callback, hideLoading) => post('consumer/registerUser', data, callback, hideLoading);

// 用户登录
export const login = (data, callback, hideLoading) => post('consumer/login', data, callback, hideLoading);

// 用户自动登录
export const autoLogin = (data, callback, hideLoading) => post('consumer/autoLogin', data, callback, hideLoading);

// 用户信息
export const userInfo = (data, callback, hideLoading) => post('consumer/inquiryUser', data, callback, hideLoading);

export const userInfoAndAreaInfo = (data, callback, hideLoading) => post('consumer/queryUserInfo', data, callback,
	hideLoading);

// 会员升级需要的会员数和销售额
export const nextUserLevel = (data, callback, hideLoading) => post('consumer/nextUserLevelData', data, callback,
	hideLoading);

// 获取邀请的会员
export const invitedUser = (data, callback, hideLoading) => post('consumer/inquiryInvitedUsers', data, callback,
	hideLoading);

// 编辑用户信息
export const editInfo = (data, callback, hideLoading) => post('consumer/updateUserField', data, callback, hideLoading);

// 发送短信验证码
export const sms = (data, callback, hideLoading) => post('sendVerificationCode', data, callback, hideLoading);

// 校验短信验证码
export const verifyCode = (data, callback, hideLoading) => post('verifyCode', data, callback, hideLoading);

// 重置登录密码
export const resetPassword = (data, callback, hideLoading) => post('resetPassword', data, callback, hideLoading);

// 修改登录密码
export const changePassword = (data, callback, hideLoading) => post('changePassword', data, callback, hideLoading);

// 打开消息推送
export const enableNotification = (data, callback, hideLoading) => post('consumer/enableNotification', data, callback,
	hideLoading);

// 关闭消息推送
export const disableNotification = (data, callback, hideLoading) => post('consumer/disableNotification', data, callback,
	hideLoading);

// 获取首页数据
export const home = (data, callback, hideLoading) => post('public/home', data, callback, hideLoading);

//获取所有小区
export const getAllCommunity = (data, callback, hideLoading) => post('communityInfomation/getAllCommunity', data,
	callback, hideLoading);

// 获取城市
export const inquiryCity = (data, callback, hideLoading) => post('public/searchCity', data, callback, hideLoading);

// 获取首页幻灯片
export const slider = (data, callback, hideLoading) => post('inquirySwiper', data, callback, hideLoading);

// 获取广告
export const advert = (data, callback, hideLoading) => post('inquiryAd', data, callback, hideLoading);

// 获取首页商品类目
export const homeProductCate = (data, callback, hideLoading) => post('public/getHomeProductCate', data, callback,
	hideLoading);

// 获取商品类目下的品牌和广告
export const productCateAddInfo = (data, callback, hideLoading) => post('public/getProductCateAddInfo', data, callback,
	hideLoading);

// 获取秒杀商品
export const secKill = (data, callback, hideLoading) => post('public/inquirySecKill', data, callback, hideLoading);

// 秒杀商品详情
export const secKillDetail = (data, callback, hideLoading) => post('public/inquirySecKill', data, callback,
	hideLoading);

// 获取团购商品
export const groupBuy = (data, callback, hideLoading) => post('public/inquiryGroupBuy', data, callback, hideLoading);

// 团购商品详情
export const groupBuyDetail = (data, callback, hideLoading) => post('consumer/groupBuyDetail', data, callback,
	hideLoading);

// 根据商品获取正在进行中的拼团
export const getGroupBuyByProduct = (data, callback, hideLoading) => post('public/getGroupBuyByProduct', data, callback,
	hideLoading);

// 抢秒杀资格
export const seckillQuanId = (data, callback, hideLoading) => post('consumer/seckillQuanId', data, callback,
	hideLoading);

// 获取首页商品组
export const productGroup = (data, callback, hideLoading) => post('public/inquiryProductGroup', data, callback,
	hideLoading);

// 获取会员注册专用商品组
export const productGroupForRegister = (data, callback, hideLoading) => post('public/inquiryProductGroupForRegister',
	data, callback, hideLoading);

// 获取商品分类
export const productCate = (data, callback, hideLoading) => post('public/getProductCate', data, callback, hideLoading);

// 获取文章标签
export const inquiryTag = (data, callback, hideLoading) => post('public/inquiryTag', data, callback, hideLoading);

// 获取文章详情
export const articleInfo = (data, callback, hideLoading) => post('public/inquiryArticle', data, callback, hideLoading);

// 获取文章列表
export const articleList = (data, callback, hideLoading) => post('public/inquiryArticlePagination', data, callback,
	hideLoading);

//搜索热门问题
export const hotQaList = (data, callback, hideLoading) => post('public/inquiryHotQa', data, callback, hideLoading);

//查询问题列表
export const queryQaList = (data, callback, hideLoading) => post('public/queryQaList', data, callback, hideLoading);

//根据标签搜索问题
export const qaList = (data, callback, hideLoading) => post('public/inquiryQa', data, callback, hideLoading);

// 获取商品列表
export const goodsList = (data, callback, hideLoading) => post('public/searchProduct', data, callback, hideLoading);

// 获取积分商品列表
export const pointGoodsList = (data, callback, hideLoading) => post('public/searchPointProduct', data, callback,
	hideLoadingqa);
// 获取商品详情
export const goodsDetail = (data, callback, hideLoading) => post('public/inquiryProductDetail', data, callback,
	hideLoading);

// 获取积分商品详情
export const pointGoodsDetail = (data, callback, hideLoading) => post('public/inquiryPointProduct', data, callback,
	hideLoading);

// 计算使用优惠券之后的优惠金额
export const calculateCouponAmount = (data, callback, hideLoading) => post('consumer/calculateCouponAmount', data,
	callback, hideLoading);

// 计算运费
export const calculateFreightAmount = (data, callback, hideLoading) => post('consumer/calculateFreightAmount', data,
	callback, hideLoading);

// 计算同城配送费
export const calculateDeliveryAmount = (data, callback, hideLoading) => post('consumer/calculateDeliveryAmount', data,
	callback, hideLoading);

// 计算秒杀订单运费(快递配送)
export const calculateSecKillFreightAmount = (data, callback, hideLoading) => post(
	'consumer/calculateSecKillFreightAmount', data, callback, hideLoading);

// 计算秒杀订单配送费(同城配送)
export const calculateSecKillDeliveryAmount = (data, callback, hideLoading) => post(
	'consumer/calculateSecKillDeliveryAmount', data, callback, hideLoading);

// 计算秒杀订单运费
export const calculateGroupBuyFreightAmount = (data, callback, hideLoading) => post(
	'consumer/calculateGroupBuyFreightAmount', data, callback, hideLoading);

// 计算秒杀订单配送费(同城配送)
export const calculateGroupBuyDeliveryAmount = (data, callback, hideLoading) => post(
	'consumer/calculateGroupBuyDeliveryAmount', data, callback, hideLoading);

// 计算积分订单运费
export const calculatePointFreightAmount = (data, callback, hideLoading) => post('consumer/calculatePointFreightAmount',
	data, callback, hideLoading);

// 获取商品海报
export const goodsPoster = (data, callback, hideLoading) => post('consumer/createPoster', data, callback, hideLoading);

// 查询收藏的商品
export const inquiryCollectedProduct = (data, callback, hideLoading) => post('consumer/inquiryProductCollect', data,
	callback, hideLoading);

// 获取商品是否已收藏
export const isProductCollected = (data, callback, hideLoading) => post('consumer/isProductCollected', data, callback,
	hideLoading);

// 收藏商品
export const collectProduct = (data, callback, hideLoading) => post('consumer/collectProduct', data, callback,
	hideLoading);

// 取消收藏商品
export const cancelCollectProduct = (data, callback, hideLoading) => post('consumer/cancelCollectProduct', data,
	callback, hideLoading);

// 评论订单
export const commentOrder = (data, callback, hideLoading) => post('consumer/changeProductComment', data, callback,
	hideLoading);

// 获取商品评论信息
export const goodsComment = (data, callback, hideLoading) => post('public/searchProductComment', data, callback,
	hideLoading);

// 添加购物车
export const addCart = (data, callback, hideLoading) => post('consumer/addProductToCart', data, callback, hideLoading);

// 根据购物车每条记录查询商品
export const productByCardIds = (data, callback, hideLoading) => post('consumer/inquiryCartProductByIds', data,
	callback, hideLoading);

// 移除购物车
export const removeCart = (data, callback, hideLoading) => post('consumer/deleteProductFromShoppingCart', data,
	callback, hideLoading);

// 移除购物车
export const clearCart = (data, callback, hideLoading) => post('consumer/clearShoppingCart', data, callback,
	hideLoading);

// 获取购物车列表
export const cartList = (data, callback, hideLoading) => post('consumer/inquiryCartProduct', data, callback,
	hideLoading);

// 设置购物车商品数量
export const setCartNum = (data, callback, hideLoading) => post('consumer/updateShoppingCartProductNum', data, callback,
	hideLoading);

// 获取购物车数量
export const getCartNum = (data, callback, hideLoading) => post('consumer/getCartProductNum', data, callback,
	hideLoading);

// 获取用户的收货地址列表
export const userShip = (data, callback, hideLoading) => post('consumer/inquiryUserDeliveryAddress', data, callback,
	hideLoading);

// 存储用户收货地址
export const saveUserShip = (data, callback, hideLoading) => post('consumer/changeUserDeliveryAddress', data, callback,
	hideLoading);

// 收货地址删除
export const removeShip = (data, callback, hideLoading) => post('consumer/changeUserDeliveryAddress', data, callback,
	hideLoading);

// 生成订单
export const createOrder = (data, callback, hideLoading) => post('consumer/changeOrder', data, callback, hideLoading);

// 生成秒杀订单
export const createSecKillOrder = (data, callback, hideLoading) => post('consumer/addSecKillOrder', data, callback,
	hideLoading);

// 生成团购订单
export const createGroupBuyOrder = (data, callback, hideLoading) => post('consumer/addGroupBuyOrder', data, callback,
	hideLoading);

// 生成积分订单
export const createPointOrder = (data, callback, hideLoading) => post('consumer/addPointOrder', data, callback,
	hideLoading);

// 取消订单
export const cancelOrder = (data, callback, hideLoading) => post('consumer/cancelOrder', data, callback, hideLoading);

// 删除订单
export const delOrder = (data, callback, hideLoading) => post('consumer/changeOrder', data, callback, hideLoading);

// 获取订单详情
export const orderDetail = (data, callback, hideLoading) => post('consumer/inquiryOrder', data, callback, hideLoading);

// 获取订单详情
export const orderCourier = (data, callback, hideLoading) => post('consumer/getCourierInfo', data, callback,
	hideLoading);

// 获取拆分后订单的总支付金额
export const orderPaymentAmount = (data, callback, hideLoading) => post('consumer/inquiryPaymentAmount', data, callback,
	hideLoading);

// 确认收货
export const confirmOrder = (data, callback, hideLoading) => post('consumer/confirmOrder', data, callback, hideLoading);

// 搜索订单
export const searchOrder = (data, callback, hideLoading) => post('consumer/searchOrder', data, callback, hideLoading);

// 查询订单数量
export const searchOrderTotal = (data, callback, hideLoading) => post('consumer/searchOrderTotal', data, callback,
	hideLoading);

// 搜索团购单
export const searchGroupBuy = (data, callback, hideLoading) => post('consumer/searchGroupBuy', data, callback,
	hideLoading);

// 团购单数量
export const searchGroupBuyTotal = (data, callback, hideLoading) => post('consumer/searchGroupBuyTotal', data, callback,
	hideLoading);

// 申请售后单
export const applyAfterSale = (data, callback, hideLoading) => post('consumer/applyOrderAfterSale', data, callback,
	hideLoading);

// 撤销售后单
export const cancelAfterSale = (data, callback, hideLoading) => post('consumer/cancelOrderAfterSale', data, callback,
	hideLoading);

// 更新售后单
export const updateAfterSale = (data, callback, hideLoading) => post('consumer/updateOrderAfterSale', data, callback,
	hideLoading);

// 填写售后单物流
export const courierAfterSale = (data, callback, hideLoading) => post('consumer/courierOrderAfterSale', data, callback,
	hideLoading);

// 分页查询售后单
export const searchAfterSale = (data, callback, hideLoading) => post('consumer/searchOrderAfterSale', data, callback,
	hideLoading);

// 查询售后单数量
export const searchAfterSaleTotal = (data, callback, hideLoading) => post('consumer/searchOrderAfterSaleTotal', data,
	callback, hideLoading);

// 查询系统通知
export const inquiryNotes = (data, callback, hideLoading) => post('inquiryNotes', data, callback, hideLoading);

// 标记系统通知为已读
export const markNoteRead = (data, callback, hideLoading) => post('markNoteRead', data, callback, hideLoading);

// 查询活动公告
export const inquiryArticle = (data, callback, hideLoading) => post('public/inquiryArticle', data, callback,
	hideLoading);

// 售后单详情
export const afterSalesInfo = (data, callback, hideLoading) => post('consumer/inquiryOrderAfterSaleDetail', data,
	callback, hideLoading);

// 小程序微信支付接口
export const wechatPay = (data, callback, hideLoading) => post('consumer/initWechatPay', data, callback, hideLoading);

// 公众号微信支付接口
export const wechatPayH5 = (data, callback, hideLoading) => post('consumer/initWechatPayH5', data, callback,
	hideLoading);

// APP微信支付接口
export const wechatPayApp = (data, callback, hideLoading) => post('consumer/initWechatPayApp', data, callback,
	hideLoading);

// 获取微信支付签名
export const getSignature = (data, callback, hideLoading) => post('consumer/getSignature', data, callback, hideLoading);

// 支付宝H5端接口
export const alipay = (data, callback, hideLoading) => post('consumer/initAlipay', data, callback, hideLoading);

// 支付宝APP端接口
export const alipayApp = (data, callback, hideLoading) => post('consumer/initAlipayApp', data, callback, hideLoading);

// 模拟支付成功接口
export const balancePay = (data, callback, hideLoading) => post('consumer/balancePay', data, callback, hideLoading);

// 优惠券列表
export const couponList = (data, callback, hideLoading) => post('public/searchCoupon', data, callback, hideLoading);

// 用户领取优惠券
export const getCoupon = (data, callback, hideLoading) => post('consumer/changeCoupon', data, callback, hideLoading);

// 用户已领取的优惠券列表
export const userCoupon = (data, callback, hideLoading) => post('consumer/searchUserCoupon', data, callback,
	hideLoading);

// 订单电子卡券
export const voucherList = (data, callback, hideLoading) => post('consumer/inquiryVoucher', data, callback,
	hideLoading);

// 获取用户奖金明细
export const getBalanceList = (data, callback, hideLoading) => post('consumer/searchUserAward', data, callback,
	hideLoading);

// 获取用户余额明细
export const getStatementList = (data, callback, hideLoading) => post('consumer/searchUserStatement', data, callback,
	hideLoading);

// 获取团队业绩明细
export const getPerformanceList = (data, callback, hideLoading) => post('consumer/searchUserPerformance', data,
	callback, hideLoading);

// 用户提现
export const userToCash = (data, callback, hideLoading) => post('consumer/applyWithdraw', data, callback, hideLoading);

// 用户提现列表
export const cashList = (data, callback, hideLoading) => post('consumer/searchUserWithdraw', data, callback,
	hideLoading);

// 查询提现详情
export const withdrawDetail = (data, callback, hideLoading) => post('consumer/inquiryUserWithdraw', data, callback,
	hideLoading);

// 查询商家
export const merchantList = (data, callback, hideLoading) => post('public/searchMerchant', data, callback, hideLoading);

// 查询商家优惠券
export const merchantCouponList = (data, callback, hideLoading) => post('public/searchMerchantCoupon', data, callback,
	hideLoading);

// 商家列表
export const nearbyMerchant = (data, callback, hideLoading) => post('consumer/inquiryNearMerchant', data, callback,
	hideLoading);

// 商家详情
export const merchantDetail = (data, callback, hideLoading) => post('public/inquiryMerchant', data, callback,
	hideLoading);

// 查询是否关注商家
export const isMerchantFollowed = (data, callback, hideLoading) => post('consumer/isMerchantFollowed', data, callback,
	hideLoading);

// 关注商家
export const followMerchant = (data, callback, hideLoading) => post('consumer/followMerchant', data, callback,
	hideLoading);

// 查询关注的商家
export const followedMerchant = (data, callback, hideLoading) => post('consumer/inquiryFollowedMerchant', data,
	callback, hideLoading);

// 取消关注商家
export const cancelFollowMerchant = (data, callback, hideLoading) => post('consumer/cancelFollowMerchant', data,
	callback, hideLoading);

// 微信订阅消息
export const wxSuscribeMsg = (data, callback, hideLoading) => post('public/inquirySuscribeMsg', data, callback,
	hideLoading);

//查询新人福利
export const inquiryProfitWelfare = (data, callback, hideLoading) => post('consumer/inquiryProfitWelfare', data,
	callback, hideLoading);

//领取新人福利
export const receiveProfitWelfare = (data, callback, hideLoading) => post('consumer/receiveProfitWelfare', data,
	callback, hideLoading);

//获取积分签到设置
export const signSetting = (data, callback, hideLoading) => post('public/getSignSetting', data, callback, hideLoading);

//是否签到
export const isPointSigned = (data, callback, hideLoading) => post('consumer/isPointSigned', data, callback,
	hideLoading);

//连续签到天数
export const signDateNum = (data, callback, hideLoading) => post('consumer/getSignDateNum', data, callback,
	hideLoading);

//积分签到
export const signPoint = (data, callback, hideLoading) => post('consumer/signPoint', data, callback, hideLoading);

//积分明细
export const pointStatementList = (data, callback, hideLoading) => post('consumer/searchUserPointStatement', data,
	callback, hideLoading);

export const updateUserImg = (data, callback, hideLoading) => post('consumer/updateUserImg', data, callback,
	hideLoading);

export const getCommunityByUserInfo = (data, callback, hideLoading) => post('consumer/getCommunityByUserInfo', data,
	callback, hideLoading);


export const getCommunityInfosByCode = (data, callback, hideLoading) => post('consumer/getCommunityInfosByCode', data,
	callback, hideLoading);

//根据物业管理系统账户获取物管系统乡村列表
export const getCommunityByAccount = (data, callback, hideLoading) => post('consumer/getCommunityByAccount', data,
	callback, hideLoading);

//根据小区ID获取楼栋信息
export const getFloorsByCommunityId = (data, callback, hideLoading) => post('consumer/getFloorsByCommunityId', data,
	callback, hideLoading);

//根据楼栋ID获取单元信息
export const getUnitsByFloorId = (data, callback, hideLoading) => post('consumer/getUnitsByFloorId', data, callback,
	hideLoading);

//根据单元ID获取房号信息
export const getRoomsByUnitId = (data, callback, hideLoading) => post('consumer/getRoomsByUnitId', data, callback,
	hideLoading);

//验证用户是否已审核过
export const userBindOwnerTest = (data, callback, hideLoading) => post('consumer/userBindOwnerTest', data,
	callback, hideLoading);

//公众号用户绑定乡村
export const verifyUserApplication = (data, callback, hideLoading) => post('consumer/verifyUserApplication', data,
	callback, hideLoading);

//用户审核
export const addUserApplication = (data, callback, hideLoading) => post('consumer/addUserApplication', data, callback,
	hideLoading);

//用户审核
export const examineApplication = (data, callback, hideLoading) => post('consumer/examineApplication', data, callback,
	hideLoading);

export const updateCurrCommunityUser = (data, callback, hideLoading) => post('consumer/updateCurrCommunityUser', data,
	callback, hideLoading);

export const searchUserApplicationsByUserId = (data, callback, hideLoading) => post(
	'consumer/searchUserApplicationsByUserId', data, callback, hideLoading);

//自动审核--TT物管版
export const autoExamineApplication = (data, callback, hideLoading) => post('proper/autoExamineApplication', data,
	callback, hideLoading);

// 根据小区code获取推荐商户
export const getMerchantByRecommend = (data, callback, hideLoading) => post('public/getMerchantByRecommend', data,
	callback, hideLoading);

//分页查询办事指南
export const inquiryArticlePagination = (data, callback, hideLoading) => post('public/inquiryArticlePagination', data,
	callback, hideLoading);

//查询事件上报
export const getEventsOrAdviceLists = (data, callback, hideLoading) => post('event/getEventsOrAdviceLists', data,
	callback, hideLoading);

//添加事件上报
export const addEvent = (data, callback, hideLoading) => post('event/addEvent', data, callback, hideLoading);

//查询事件上报类型
export const getTagsByType = (data, callback, hideLoading) => post('event/getTagsByType', data, callback, hideLoading);

//事件上报详情
export const getDetailById = (data, callback, hideLoading) => post('event/getDetailById', data, callback, hideLoading);

//查询邻里圈子
export const getNeighborList = (data, callback, hideLoading) => post('neighbor/getNeighborList', data, callback,
	hideLoading);

//邻里圈子点赞
export const likeOrCancel = (data, callback, hideLoading) => post('neighbor/likeOrCancel', data, callback, hideLoading);

//邻里圈子评论
export const getNeighborComments = (data, callback, hideLoading) => post('neighbor/getNeighborComments', data, callback,
	hideLoading);

//邻里圈子新增
export const addNeighborShare = (data, callback, hideLoading) => post('neighbor/addNeighborShare', data, callback,
	hideLoading);

//邻里圈子新增评论
export const addNeighborComment = (data, callback, hideLoading) => post('neighbor/addNeighborShareComment', data,
	callback, hideLoading);

//办事指南模糊查询
export const LikeTypeName = (data, callback, hideLoading) => post('public/LikeTypeName', data, callback, hideLoading);

//根据用户ID和小区ID查询业主ID
export const getOwnerUserInfoByUserIdAndCommunityId = (data, callback, hideLoading) => post(
	'proper/getOwnerUserInfoByUserIdAndCommunityId', data, callback, hideLoading);

//获取模块信息
export const getPortalList = (data, callback, hideLoading) => post('portal/getPortalList', data, callback, hideLoading);

//从后台获取有效的AccessToken
export const getAccessToken = (data, callback, hideLoading) => post('consumer/getAccessToken', data, callback,
	hideLoading);

//微信校验图片
export const WXImgSecCheck = (data, callback, hideLoading) => post('checkImg/WXImgSecCheck', data, callback,
	hideLoading);

//微信校验文本
export const WXMsgSecCheck = (data, callback, hideLoading) => post('checkMsg/WXMsgSecCheck', data, callback,
	hideLoading);

//获取关于小区和我的乡村详情
export const getCommunityDetails = (data, callback, hideLoading) => post('consumer/getCommunityDetails', data, callback,
	hideLoading);

//获取文章列表
export const getArticalList = (data, callback, hideLoading) => post('consumer/activity/currency/appletQueryArticle',
	data, callback, hideLoading);

//获取文章详情
export const getArticalDetails = (data, callback, hideLoading) => post('consumer/activity/currency/articelQueryDetail',
	data, callback, hideLoading);

//征兵报名
export const joinTheArmy = (data, callback, hideLoading) => post('consumer/joinTheArmy/manage', data, callback,
	hideLoading);

//获取团员交费列表
export const getLeaguePayList = (data, callback, hideLoading) => post('consumer/memberPay/queryList', data, callback,
	hideLoading);

//获取缴费详情 
export const getPayDetail = (data, callback, hideLoading) => post('consumer/memberPay/queryDetail', data, callback,
	hideLoading);

// 管理富文本信息
export const managerActivity = (data, callback, hideLoading) => post('consumer/activity/currency/manageArticle', data,
	callback, hideLoading);

// 管理文本信息
export const managerEnvent = (data, callback, hideLoading) => post('consumer/eventCurrency/manage', data, callback,
	hideLoading);

// 查询文本信息列表
export const queryEnventList = (data, callback, hideLoading) => post('consumer/eventCurrency/queryList', data, callback,
	hideLoading);

// 根据ID查询信息
export const queryEnventById = (data, callback, hideLoading) => post('consumer/eventCurrency/getById', data, callback,
	hideLoading);
// 老年人高龄津贴申请详情
export const getOldManById = (data, callback, hideLoading) => post('flow/getOldManById', data, callback, hideLoading);

// 最低生活保障申请详情
export const getLifeById = (data, callback, hideLoading) => post('flow/getLifeById', data, callback, hideLoading);

// 困难群众临时救助申请详情
export const getPoorPeopleById = (data, callback, hideLoading) => post('flow/getPoorPeopleById', data, callback,
	hideLoading);
	
// 根据id查询就业困难人员申请详情
export const getEmploymentById = (data, callback, hideLoading) => post('flow/getEmploymentById', data, callback,
	hideLoading);
	
// 根据id查询农保申请详情
export const getAgriculturalById = (data, callback, hideLoading) => post('flow/agricultural/getById', data, callback,
	hideLoading);
	
// 根据id查询生育服务登记申请详情
export const getBirthById = (data, callback, hideLoading) => post('flow/birth/getById', data, callback,
	hideLoading);
	
// 根据id查询养老保险注销申请详情
export const getCancelById = (data, callback, hideLoading) => post('flow/cancel/getById', data, callback,
	hideLoading);
	
// 根据id查询居民上户申请详情
export const getHouseholdById = (data, callback, hideLoading) => post('flow/household/getById', data, callback,
	hideLoading);
	
// 根据id查询医保代交申请详情
export const getMedicalById = (data, callback, hideLoading) => post('flow/medical/getById', data, callback,
	hideLoading);
	
// 根据id查询养老保险领取申请详情
export const getRegistrationById = (data, callback, hideLoading) => post('flow/registration/getById', data, callback,
	hideLoading);
	
// 开始流程flow/restart-process
export const startProcess = (data, callback, hideLoading) => post('flow/start-process', data, callback,
	hideLoading);
	
// 重新提交流程
export const reStartProcess = (data, callback, hideLoading) => post('flow/restart-process', data, callback,
	hideLoading);

// 指定用户信息上报接口
export const idcardSubmit = (data, callback, hideLoading) => post('fase/idcardSubmit', data, callback, hideLoading);

// 获取verify_token接口
export const verifyToken = (data, callback, hideLoading) => post('/fase/verifyToken', data, callback, hideLoading);

// 获取查询认证结果接口
export const faceprint = (data, callback, hideLoading) => post('/fase/faceprint', data, callback, hideLoading);

// 获取查询是否进行人脸核验
export const getVerification = (data, callback, hideLoading) => post('/fase/getVerification', data, callback,
	hideLoading);

// 获取视频活体检测验证码接口
export const sessioncode = (data, callback, hideLoading) => post('/fase/sessioncode', data, callback, hideLoading);

// 发起人取消流程申请
export const cancelProcess = (data, callback, hideLoading) => post('flow/cancelProcess', data, callback, hideLoading);

// 查询我发起的流程
export const myCreateProcess = (data, callback, hideLoading) => post('/flow/myCreateProcess', data, callback,
	hideLoading);

// 查询流程图
export const getProcessDiagram = (data, callback, hideLoading) => post('/flow/getProcessDiagram', data, callback,
	hideLoading);

// 活动报名
export const enrollActivity = (data, callback, hideLoading) => post('activity/enrollActivity', data, callback,
	hideLoading);

// 查询活动
export const queryActivities = (data, callback, hideLoading) => post('activity/queryActivities', data, callback,
	hideLoading);


export const initWeChatPay = (data, callback, hideLoading) => post('consumer/memberPay/initWeChatPay', data, callback,
	hideLoading);

// 添加登记记录
export const addRegister = (data, callback, hideLoading) => post('consumer/register/add', data, callback,
	hideLoading);

export const queryRegisterList = (data, callback, hideLoading) => post('consumer/register/queryList', data, callback,
	hideLoading);

export const queryRegisterById = (data, callback, hideLoading) => post('consumer/register/queryDetail', data, callback,
	hideLoading);
	
export const getRegisterHandleDetail = (data, callback, hideLoading) => post('consumer/register/getRegisterHandleDetail', data, callback,
	hideLoading);

// 根据用户ID查询房屋信息
export const queryRoomInfoByUserId = (data, callback, hideLoading) => post('consumer/getRoomsByUserId', data, callback,
	hideLoading);

// 根据用户ID绑定房屋信息
export const addRelationByUserId = (data, callback, hideLoading) => post('consumer/addRelationByUserId', data, callback,
	hideLoading);

// 根据用户ID解绑房屋信息
export const removeRelationByUserId = (data, callback, hideLoading) => post('consumer/removeRelationByUserId', data,
	callback, hideLoading);

// 根据用户ID获取关系
export const getOwnerRelationByUserId = (data, callback, hideLoading) => post(
	'consumer/proper/getOwnerRelationByUserId', data, callback, hideLoading);

// 修改个人信息
export const addOrUpdateOwner = (data, callback, hideLoading) => post('consumer/proper/addOrUpdateOwner', data,
	callback, hideLoading);

// 根据身份证号模糊查询业主信息
export const getOwnerByIdCard = (data, callback, hideLoading) => post('consumer/proper/getOwnerByIdCard', data,
	callback, hideLoading);

// 根据用户ID查询业主信息
export const getOwnerByUserId = (data, callback, hideLoading) => post('consumer/proper/getOwnerByUserId', data,
	callback, hideLoading);

// 绑定用户家庭关系removeOwnerRelation
export const setOwnerRelation = (data, callback, hideLoading) => post('consumer/proper/setOwnerRelation', data,
	callback, hideLoading);

// 删除用户家庭关系
export const removeOwnerRelation = (data, callback, hideLoading) => post('consumer/proper/removeOwnerRelation', data,
	callback, hideLoading);

//根据roomId查询当前房屋人员
export const queryUserOfRoom = (data, callback, hideLoading) => post('consumer/proper/getOwners', data, callback,
	hideLoading);

// 增加或修改我的就业创业登记基本信息
export const addOrUpdateResume = (data, callback, hideLoading) => post('consumer/employment/insertOrUpdate', data,
	callback, hideLoading);

export const queryResumeList = (data, callback, hideLoading) => post('consumer/employment/queryList', data, callback,
	hideLoading);

// 根据用户ID查询我的就业创业登记信息
export const queryResumeByUserId = (data, callback, hideLoading) => post('consumer/employment/queryByUserId', data,
	callback, hideLoading);

// 修改或添加创业就业教育信息
export const addOrUpdateEducation = (data, callback, hideLoading) => post('consumer/study/update', data, callback,
	hideLoading);

// 修改或添加创业就业教育信息
export const addOrUpdateWork = (data, callback, hideLoading) => post('consumer/work/update', data, callback,
	hideLoading);

// 修改或添加创业就业附件信息
export const addOrUpdateFiles = (data, callback, hideLoading) => post('consumer/enclosure/update', data, callback,
	hideLoading);


// 获取所有乡村
export const getCommunityByAreaCode = (data, callback, hideLoading) => post('consumer/proper/getCommunityByAreaCode',
	data, callback, hideLoading);

// 查询所有小区
export const getResidenceByAreaCode = (data, callback, hideLoading) => post('consumer/proper/getResidenceByAreaCode',
	data, callback, hideLoading);

// 获取所有网格
export const getAllParentGrids = (data, callback, hideLoading) => post('consumer/gridBasic/getAllParentGrids', data,
	callback,
	hideLoading);

//我的报名列表
export const queryEnroll = (data, callback, hideLoading) => post('activity/queryEnrollActivities', data, callback,
	hideLoading);

// 获取活动报名信息
export const getActivityById = (data, callback, hideLoading) => post('activity/getActivityById', data, callback,
	hideLoading);


// 修改用户申请信息
export const userApplicationAddRoomInfo = (data, callback, hideLoading) => post('consumer/userApplicationAddRoomInfo',
	data, callback,
	hideLoading);

// 查询党组织列表
export const queryListParty = (data, callback, hideLoading) => post('consumer/partyOrganization/getHeadquarters', data,
	callback, hideLoading);

// 查询党组织详情
export const queryMember = (data, callback, hideLoading) => post('consumer/partyOrganizationOwnerRel/query', data,
	callback, hideLoading);

// 查询是否可以绑定房间
export const hasApplication = (data, callback, hideLoading) => post('consumer/hasApplication', data, callback,
	hideLoading);

// 根据ownerId查询人物关系consumer/proper/updateOwnerRelation
export const getOwnerRelationByFromId = (data, callback, hideLoading) => post('consumer/getOwnerRelationByFromId', data,
	callback,
	hideLoading);

// 修改任务绑定关系
export const updateOwnerRelation = (data, callback, hideLoading) => post('consumer/proper/updateOwnerRelation', data,
	callback,
	hideLoading);

export const verificationQueryConsumer = (data, callback, hideLoading) => post('flow/verificationQueryConsumer', data, callback,hideLoading);

export const myProcessOwnerInfo = (data, callback, hideLoading) => post('flow/myProcessOwnerInfo', data, callback,hideLoading);

// 推送消息接口
export const deviceAlarmPush = (data, callback, hideLoading) => post('lezhiDevice/deviceAlarmPush', data, callback,hideLoading);

// H5后门推送消息接口
export const deviceAlarmPushH5 = (data, callback, hideLoading) => post('lezhiDevice/deviceAlarmPushH5', data, callback,hideLoading);

// 获取流程审核记录
export const getProcessHistory = (data, callback, hideLoading) => post('flow/process-history', data, callback,hideLoading);

// 检测推送消息是否过期
export const checkPushInfoIsExpire = (data, callback, hideLoading) => post('push/checkInfoIsExpire', data, callback,hideLoading);

// 获取首页滚动条配置
export const getNoticeByAreaCode = (data, callback, hideLoading) => post('getNoticeByAreaCode', data, callback,hideLoading);

// 获取表单项
export const getFormInfoPage = (data, callback, hideLoading) => post('form/queryFormInfoPage', data, callback,hideLoading);

// 根据表单列表获取表单信息
export const queryFormFiledByInfoId = (data, callback, hideLoading) => post('form/queryFormFiledByInfoId', data, callback,hideLoading);

// 获取乐至融媒体数据
export const getFinancialMediaPage = (data, callback, hideLoading) => post('lezhiMedia/getFinancialMediaPage', data, callback,hideLoading);

// 获取乐至融媒体详情
export const getFinancialMediaById = (data, callback, hideLoading) => post('lezhiMedia/getFinancialMediaById', data, callback,hideLoading);